In the digital still camera, CCD (Charge Coupled Device) image sensor is generally used as image pick-up device. In the CCD image sensor, the dynamic range of photographable luminance area is very narrow as compared to silver photographic film. In order to compensate for narrowness of the dynamic range of this CCD image sensor, there have been conventionally proposed digital still cameras having such a function to pick up images of the same object plural times by different exposure values to additively synthesize the plural images different in exposure value which have been obtained by image pick-up to generate image having broad dynamic range.
In the case where plural images are additively synthesized in order to ensure the dynamic range in this way, the number of gradations of image after synthesis becomes great. For example, if the number of gradations of ordinary image data obtained from the CCD image sensor is assumed to be 8 bits, when four images different in exposure value are additively synthesized, the number of gradations of the image after additive synthesis becomes 10 bits. However, the numbers of gradations of format of media for recording picked up images obtained by the digital still camera, format of display for displaying picked up images and/or format of interface for outputting picked up images are determined in advance. For this reason, in such digital still cameras, it was necessary to compress the number of gradations of synthesized image to carry out conversion into the number of gradations adapted to these formats.
In the case where the number of gradations is compressed, if such compression is simply linearly carried out, it is sufficient to carry out, e.g., such a processing to truncate (round down) low order bits of respective pixels of synthetic image. For example, in the case where there is a need to compress image having the number of gradations of 10 bits into image having the number of gradations of 8 bits, it is sufficient to truncate (round down) low order 2 bits of 10 bits. However, when image obtained by synthesizing plural images is linearly gradation-compressed in this way, there are instances where the contrast becomes vague so that there results image difficult to see when displayed. In the case where gradation compression is carried out with respect to such image in which image synthesis is carried out so that the dynamic range has been broadened, it is general that correction of luminance level is also carried out at the same time so that there results image easy to see in which the contrast is clear.
As a technology for carrying out correction of luminance level along with gradation compression, gradation compression technique utilizing histogram averaging method is conventionally known.
Explanation will be given below in connection with the basic algorithm of gradation compression utilizing this histogram averaging method.
First, histogram indicating frequency distribution with respect to all luminance values is detected with respect to input image (image before conversion).
Subsequently, those frequencies are accumulated in order from lower luminance value to higher luminance value on the basis of the detected histogram to generate cumulative (accumulated) histogram. This cumulative histogram can be represented as a graph in which luminance level of input image (image before conversion) is taken on the abscissa and frequency is taken on the ordinate.
Subsequently, the ordinate of the cumulative histogram is replaced by luminance value of output image to generate correction curve. At this time, the maximum cumulative frequency of the cumulative histogram, i.e., value corresponding to the number of pixels of input image is caused to correspond to the maximum value (Ymax) of the number of gradations of output image (image after conversion), and the minimum cumulative frequency of the cumulative histogram, i.e., “0” is caused to correspond to the minimum value (Ymin) of the number of gradations of output image. For example, if the number of gradations of output image is 8 bits, there is generated correction curve in which the maximum cumulative frequency of the cumulative histogram is caused to correspond to luminance value of “255” and the minimum cumulative frequency of the cumulative histogram is caused to correspond to luminance value of “0”.
The correction curve prepared in this way is stored into memory as conversion table.
In carrying out actual gradation compression processing, luminance value of output image with respect to luminance value of inputted image is detected while making reference to this conversion table to carry out conversion of the number of gradations.
The histogram is prepared in this way to carry out conversion of luminance value, whereby distribution of luminance at the entirety of image of output image is equalized so that there results image in which the contrast has been emphasized. For this reason, in the above-mentioned gradation compression technique utilizing the histogram averaging method, it is possible to convert input image of higher number of gradations into output image of lower number of gradations while correcting the image characteristic such as contrast, etc.
Even in the case where such gradation compression technique utilizing the histogram averaging method is used, there are instances where correction of luminance value is not carried out in an optimum manner so that image which has been caused to undergo conversion results in image difficult to see.
For example, in the case where image having peak characteristic at frequency of luminance is inputted, luminance of the same level existing in the vicinity of peak is dispersed over broad range in the method utilizing the histogram averaging method. In such a case, pixels having luminance levels close to each other are converted into pixels having large luminance difference so that output image becomes very difficult to see. In addition, for example, in the case where image having small luminance difference is inputted, correction is made in such a manner that its luminance difference is dispersed in the entire gradation area in the method utilizing the histogram averaging method. In such a case, output image becomes too bright on the whole so that there results image apparently unnatural.